package com.gx.codec;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.gx.utils.DateUtils;

import java.io.IOException;
import java.util.Date;

public class Date2FullStringWithDateSerializer extends JsonSerializer<Date> {

    @Override
    public void serialize(Date input, JsonGenerator writer, SerializerProvider arg2)
            throws IOException, JsonProcessingException {
        writer.writeString(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, input));
    }

}
